package com.itheima.api2;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Demo9 {
    public static void main(String[] args) {
        //methd1();
        String s="2020-2-2 2:2:2";
        DateTimeFormatter dateTimeFormatter=DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime localDateTime = LocalDateTime.parse(s, dateTimeFormatter);


    }

    private static void methd1() {
        LocalDateTime localDateTime=LocalDateTime.now();
        System.out.println(localDateTime);
        DateTimeFormatter dateTimeFormatter=DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss");
        String s = localDateTime.format(dateTimeFormatter);
        System.out.println(s);
    }
}
